#ifndef EXP_EXPRESSION_H_
#define EXP_EXPRESSION_H_

#include "expression.h"
#include <iostream>

class ExpExpression : public Expression
{
private:
	Expression *lhs, *rhs;
public:
	ExpExpression(Expression *left, Expression *right)
		: lhs(left), rhs(right)
	{
	}

	float value() { return  pow(this->lhs->value(), this->rhs->value()); }
	virtual void printInfix() { std::cout << '('; this->lhs->printInfix(); std::cout << " ^ "; this->rhs->printInfix(); std::cout << ')'; };
	virtual void printRpn() { this->lhs->printRpn(); this->rhs->printRpn(); std::cout << "^ "; }
	~ExpExpression() 
	{
		delete this->lhs;
		delete this->rhs;
	}
};

#endif